package com.fyzk.activity.lottery.zc_new;


import android.content.Intent;
import android.view.View;

import com.fyzk.activity.lottery.zc_new.adapter.ZCBaseAdapter;
import com.fyzk.activity.lottery.zc_new.adapter.ZCJQCAdapter_New;
import com.fyzk.activity.zhifu.zc.ZhiFu_JQC_Activity;
import com.fyzk.bean.ZCGameQueueItem;
import com.tyjc.lottery.R;
import com.fyzk.utils.HelpUrlConstants;
import com.fyzk.utils.LotteryIDUtils;

import java.util.List;

public class OldFootballJQCActivity_New extends ZCBaseActivity_New{
	
	private ZCBaseAdapter adapter;

	@Override
	protected String getTopTitle() {
		// TODO Auto-generated method stub
		return getString(R.string.zc_jqc);
	}

	@Override
	protected int getLotteryID() {
		// TODO Auto-generated method stub
		return LotteryIDUtils.ZCJQC_LOTTERY_ID_INT;
	}

	@Override
	protected boolean isHiddenListHead() {
		return true;
	}

	@Override
	protected void changeAdapter(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		adapter.setList(infors);
	}

	@Override
	protected ZCBaseAdapter getAdapter(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		adapter = new ZCJQCAdapter_New(this, infors);
		adapter.setOnZCTongJiListener(this);
		return adapter;
	}

	@Override
	protected int minChangCi() {
		// TODO Auto-generated method stub
		return 4;
	}
	
	@Override
	protected int getListTitleVis() {
		// TODO Auto-generated method stub
		return View.GONE;
	}

	@Override
	protected void jiSuanZhu(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		int zhu = 1;
		for (int i = 0; i < infors.size(); i++) {
			ZCGameQueueItem info = infors.get(i);
			
			if ((info.isCheckQiu0_home || info.isCheckQiu1_home || info.isCheckQiu2_home || info.isCheckQiu3_home) && 
					(info.isCheckQiu0_away || info.isCheckQiu1_away || info.isCheckQiu2_away || info.isCheckQiu3_away)) {
				changCi++;
			}
			
			zhu *= info.ban_clickNum * info.quan_clickNum; 
		}
		zhuShu = zhu;
	}
	
	@Override
	protected void randomBallNum(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		for (int i = 0; i < infors.size(); i++) {
			ZCGameQueueItem info = infors.get(i);
			int home = (int) (Math.random()*4);
			int away = (int) (Math.random()*4);
			switch (home) {
			case 0:
				info.isCheckQiu0_home = true;
				break;
			case 1:
				info.isCheckQiu1_home = true;
				break;
			case 2:
				info.isCheckQiu2_home = true;
				break;
			case 3:
				info.isCheckQiu3_home = true;
				break;
			default:
				break;
			}
			
			switch (away) {
			case 0:
				info.isCheckQiu0_away = true;
				break;
			case 1:
				info.isCheckQiu1_away = true;
				break;
			case 2:
				info.isCheckQiu2_away = true;
				break;
			case 3:
				info.isCheckQiu3_away = true;
				break;
			default:
				break;
			}
			info.ban_clickNum = 1;
			info.quan_clickNum = 1;
		}
	}
	
	@Override
	protected int getWcodeID(int zhuShu, boolean isDanTuo) {
		// TODO Auto-generated method stub
		if (zhuShu > 1) {
			return LotteryIDUtils.ZCJQC_LOTTERY_COMMON_FU_INT;
		}else{
			return LotteryIDUtils.ZCJQC_LOTTERY_COMMON_DAN_INT;
		}
	}

	@Override
	protected String getHelpUrl() {
		// TODO Auto-generated method stub
		return HelpUrlConstants.Help_ZCJQC;
	}

	@Override
	protected String getHelpTitle() {
		// TODO Auto-generated method stub
		return getString(R.string.help_zcjqc);
	}

	@Override
	protected Intent getZhiFuIntent() {
		return new Intent(getContext(), ZhiFu_JQC_Activity.class);
	}
}
